import request from "@/utils/axios/request";

interface QuesType {
  id?: string;
  name?: string;          // 题目类型名称
  data: Array<any>;       // 题目类型数据
}

const getQuesType = (params: { pageNum?: number; pageSize?: number; id?: string; name?: string; }) => {
  return request.get(`/bank/getQuseType?pageNum=${params.pageNum}&pageSize=${params.pageSize}&name=${params.name}`)
}

const updateQuesType = (params: QuesType) => {
  return request.post(`/bank/updateQuesType`, params)
}

const delQuesType = (ids: Array<number>) => {
  return request.post(`/bank/delQuesType`, ids)
}

const addQuesType = (params: QuesType) => {
  return request.post(`/bank/addQuesType`, params)
}

const quesTypeApi = {
  getQuesType,
  updateQuesType,
  delQuesType,
  addQuesType
}

export default quesTypeApi